Content adaptive impairments compensation filtering for high efficiency video coding

ABSTRACT

A system and method for quality restoration filtering is described that can be used either in conjunction with video coding, or standalone for postprocessing. It uses wiener filtering approach in conjunction with an efficient codebook representation.

CLAIM OF PRIORITY

This application is a continuation of U.S. patent application Ser. No.14/657,696, filed on Mar. 13, 2015, which is a continuation of U.S.patent application Ser. No. 12/974,645, filed on Dec. 21, 2010, whichare incorporated by reference in their entireties for all purposes.

FIELD

This disclosure relates to encoding and decoding of video signals, andmore particularly, to codebook-based encoding and decoding of adaptivefilters used for quality restoration.

BACKGROUND

The advent of digital multimedia such as digital images, speech/audio,graphics, and video have significantly improved various applications aswell as opened up brand new applications due to relative ease by whichit has enabled reliable storage, communication, transmission, and,search and access of content. Overall, the applications of digitalmultimedia have been many, encompassing a wide spectrum includingentertainment, information, medicine, and security, and have benefitedthe society in numerous ways. Multimedia as captured by sensors such ascameras and microphones is often analog, and the process of digitizationin the form of Pulse Coded Modulation (PCM) renders it digital. However,just after digitization, the amount of resulting data can be quitesignificant as is necessary to re-create the analog representationneeded by speakers and/or TV display. Thus, efficient communication,storage or transmission of the large volume of digital multimediacontent requires its compression from raw PCM form to a compressedrepresentation. Thus, many techniques for compression of multimedia havebeen invented. Over the years, video compression techniques have grownvery sophisticated to the point that they can often achieve highcompression factors between 10 and 100 while retaining highpsycho-visual quality, often similar to uncompressed digital video.

While tremendous progress has been made to date in the art and scienceof video compression (as exhibited by the plethora of standards bodiesdriven video coding standards such as MPEG-1, MPEG-2, H.263, MPEG-4part2, MPEG-4 AVC/H.264. MPEG-4 SVC and MVC, as well as industry drivenproprietary standards such as Windows Media Video, RealVideo, On2 VP,and the like), the ever increasing appetite of consumers for even higherquality, higher definition, and now 3D (stereo) video, available foraccess whenever, wherever, has necessitated delivery via various meanssuch as DVD/BD, over the air broadcast, cable/satellite, wired andmobile networks, to a range of client devices such as PCs/laptops, TVs,set top boxes, gaming consoles, portable media players/devices, andsmartphones, fueling the desire for even higher levels of videocompression. In the standards-body-driven standards, this is evidencedby the recently started effort by ISO MPEG in High Efficiency Videocoding which is expected to combine new technology contributions andtechnology from a number of years of exploratory work on H.265 videocompression by ITU-T standards committee.

All aforementioned standards employ a general interframe predictivecoding framework that involves reducing temporal redundancy bycompensating for motion between frames of video by first dividing aframe into blocks and assigning motion vector/s to each block of a frameto be coded, with respect to a past decoded frame; these motion vectorsare then transmitted to the decoder and used to generate a motioncompensated prediction frame that is differenced with a past decodedframe and coded block by block, often by transform coding. It has beenlong recognized that at high compression factors at which today's stateof the art codecs operate, motion compensated transform coding processmay generate coding artifacts that range from coding noise (e.g.mosquito effects), blockiness, bleeding, to ringing. In fact to mitigatesome of these coding artifacts, most state of the art codecs includedeblocking filters as well as sometimes ringing, as postprocessingfilters. Often deblocking is done in-loop as compared to postprocessingthat can be done out of loop. Often such deblocking is able to suppressvisual quality artifacts but does not give much coding quality gain.

Recognizing this, over last few years research effort has been underwayto design additional filters that can improve both the visual and codingquality. Further, since coding quality can vary a lot depending oncontent of video sequences, contrast ratio, noise level, and operatingbit-rates, it is desirable that the filters are adaptive rather thanfixed to get maximum benefit of such a filter to improve prediction andthus help improve compression efficiency. The mathematical procedureused to compute filter coefficients is based on Wiener Hopf equation andcomputes filter coefficients (e.g. an array of 5×5 or 7×7 or 9×9coefficients), which are either directly or differentially sent for eachframe of every video sequence.

According to the basic theory of adaptive filtering, cross-correlationand autocorrelation matrices are accumulated, from which the optimalWiener filter can be computed by solving the Wiener Hopf equation asfollows.

Let x(n) be the input signal, y(n) be the output, and h(n) representfilter coefficients.

Filter Output:

${y(n)} = {\sum\limits_{k = 0}^{N - 1}{{h(k)}{x\left( {n - k} \right)}}}$

Error Signal:

e(n)=d(n)−y(n)

Mean Square Error:

J=E[e ²(n)]

In Vector Form:

${x(n)} = \begin{bmatrix}{x(n)} \\{x\left( {n - 1} \right)} \\\vdots \\{x\left( {n - N + 1} \right)}\end{bmatrix}$ and $h = \begin{bmatrix}{h(0)} \\{h(1)} \\\vdots \\{h\left( {N - 1} \right)}\end{bmatrix}$ y(n) = h^(T)x(n) = x(n)^(T)h $\begin{matrix}{{E\left\lbrack {e^{2}(n)} \right\rbrack} = {E\left\lbrack \left( {{d(n)} - {y(n)}} \right)^{2} \right\rbrack}} \\{= {{E\left\lbrack {d^{2}(n)} \right\rbrack} - {2{E\left\lbrack {{d(n)}{x(n)}^{T}} \right\rbrack}h} + {h^{T}{E\left\lbrack {{x(n)}{x(n)}^{T}} \right\rbrack}h}}} \\{= {P_{d} - {2R_{dx}^{T}h} + {h^{T}R_{xx}h}}}\end{matrix}$

Where, P_(d) is a scalar.

Crosscorrelation Row Vector:

R _(dx) =E[d(n)x(n)^(T)]

Autocorrelation Matrix:

R _(xy) =E[x(n)x(n)^(T)]

To find minimum, the derivative is taken and set to zero as follows:

$\frac{\partial{E\left\lbrack {e^{2}(n)} \right\rbrack}}{\partial{h(k)}} = {{{{- 2}R_{dx}^{T}} + {2R_{xx}h}} = 0}$

Solving for h, the Wiener Hopf equation is as follows:

h=R _(xy) ⁻¹ R _(dx)

The Wiener Hopf equation determines optimum filter coefficients in meansquare error, and the resulting filter is called the ‘wiener’ filter.

In the above equation, h is the vector of filter coefficients. R_(xx) isthe autocorrelation matrix (or block data of reference frame) and R_(dx)is a cross-correlation matrix/row vector (between the source frame andreference frame block data).

While the aforementioned mathematical procedure can calculate filtercoefficients, there are significant issues in practical integration ofthis approach in a video coding system. In context of H.264 and H.265development, a number of proposals have been made to address PictureBased (ALF); Block Based (ALF); Quad-tree Based (QALF); Spatialprediction of coefficients; Postfilter.

A limitation, however, is that the process is computationally expensive(non-separable filters require more computations than separablefilters), iterative typically requiring 3-12 full iterations to computefilter coefficients, and further often requires sending of manycoefficients (40-80 coefficients) per frame, which even whendifferentially coded can cost for instance around 300-600 bits per frameof Common Intermediate Format (“CIF”) resolution video, while offeringat times limited gains (e.g. due to rounding of coefficients, standardcoefficients being good match to the content etc). Further some methodssend a macroblock or quad-tree based block map to indicate blocks wheresuch filter is turned ‘on’ or ‘off’; this process can increase overheadbit cost by another 200-400 bits, such that the total bit cost per frameof 500-1000 bits. This makes such a system expensive in overhead bitcost, inflexible, and excessively complex.

Additional information related to adaptive filtering may be found in thefollowing references, each of which is incorporated fully by reference,for all purposes:

-   -   T. Chujoh et al, “Block Based Adaptive Loop Filter,”        ITU-Telecommunications Standardization Sector, VCEG, VCEG-AI18,        Germany, July 2008.    -   T. Chujoh et al, “Specification and experimental results of        Quad-tree-based Adaptive Loop Filter,” ITU-Telecommunications        Standardization Sector, VCEG, VCEG-AK22, Japan, April 2009.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an exemplary video encoding/decoding system accordingto one embodiment.

FIG. 2 illustrates several components of an exemplary encoding device,in accordance with one embodiment.

FIG. 3 illustrates several components of an exemplary decoding device,in accordance with one embodiment.

FIG. 4 illustrates an “offline” routine for generating a codebookrepresenting a plurality of sets of Quality-Restoration (“QR”) FilterCoefficients, in accordance with one embodiment.

FIGS. 5a-h show coefficient-pixel locations of various filters used inquality restoration filtering, in accordance with various embodiments.

FIGS. 6a-d show exemplary coefficients of various filter used in qualityrestoration filtering, in accordance with various embodiments.

FIG. 7 illustrates a video encoder including a QR Codebook FilterEncoder, in accordance with one embodiment.

FIG. 8 illustrates a video decoder including a QR Codebook FilterDecoder, in accordance with one embodiment.

FIG. 9 illustrates a QR Codebook Filter Encoder in accordance with oneembodiment.

FIGS. 10a-f illustrate various organizations of pictures, to whichvarious embodiments may be applied.

FIG. 11 illustrates a QR Codebook Filter Decoder in accordance with oneembodiment.

FIG. 12 illustrates a fast QR Codebook Filter Encoder in accordance withone embodiment.

FIG. 13 illustrates a QR filter Codebook search routine, such as may beperformed by an encoder in accordance with one embodiment.

FIG. 14 illustrates a fast QR Codebook Filter Encoder with a spectralupdate encoder, in accordance with one embodiment.

FIG. 15 illustrates a QR Codebook Filter Decoder in accordance with oneembodiment.

FIGS. 16a-b illustrate an exemplary transform coefficient scanning andmask used by various embodiments.

FIG. 17 illustrates a fast IC Codebook Filter Encoder with a spectralupdate encoder and updatable codebook, in accordance with oneembodiment.

FIG. 18 illustrates a IC Codebook Filter Decoder in accordance with oneembodiment.

FIG. 19 illustrates an exemplary bitstream syntax for IC Codebook Filterencoders and decoders in accordance with various embodiments.

FIGS. 20a-b illustrates a sequence of pictures or frames within a videostream, in accordance with various embodiments.

FIG. 21 illustrates a routine for encoding a IC filter for a picture ofa video into a bitstream using a codebook, in accordance with oneembodiment.

FIG. 22 illustrates a IC filter coefficient-set update subroutine, inaccordance with one embodiment.

FIG. 23 illustrates a routine for encoding and updating a IC filter fora picture of a video into a bitstream using one or more codebooks, inaccordance with one embodiment.

FIG. 24 illustrates a routine for decoding a IC filter for a picture ofa video from a bitstream using one or more codebooks, in accordance withone embodiment.

DETAILED DESCRIPTION

The detailed description that follows is represented largely in terms ofprocesses and symbolic representations of operations by conventionalcomputer components, including a processor, memory storage devices forthe processor, connected display devices and input devices. Furthermore,these processes and operations may utilize conventional computercomponents in a heterogeneous distributed computing environment,including remote file Servers, computer Servers and memory storagedevices. Each of these conventional distributed computing components isaccessible by the processor via a communication network.

The phrases “in one embodiment,” “in various embodiments,” “in someembodiments,” and the like are used repeatedly. Such phrases do notnecessarily refer to the same embodiment. The terms “comprising,”“having,” and “including” are synonymous, unless the context dictatesotherwise.

Overview

As discussed below, in accordance with various embodiments, contentadaptive techniques may be employed to perform impairments-compensationfilter coefficients calculation and codebook-based representation toperform filtering to improve coding efficiency in motion-compensatedvideo coding. Various systems and methods for impairments-compensationfiltering of video to improve prediction efficiency of interframe videocoding are described herein.

Various techniques, as described below, may be efficient in bits, asonly an index to a filter stored in the codebook may be transmitted, asopposed to transmitting the filter itself. Coding an index is moreefficient than coding actual coefficients or sending differentiallyencoded filter coefficients. While the number of actual indices sentdepends on the number of partitions, the techniques described below maybe more efficient in bit-rate than previous approaches using similarpartition types.

The techniques described below may additionally offer reducedcomputational complexity, as unlike existing non-codebook basedsolutions, they may avoid the need to simultaneously compute wienerfilters of different sizes (e.g. 5×5, 7×7, 9×9) and/or types (e.g.,non-symmetric and point symmetric) and iteratively compute block mapswhere filters will be applied or not, and then again re-compute improvedfilters of these sizes and types to select the best candidate based onexhaustive rate distortion optimization. Instead, the techniquesdescribed below rely on content-based processing to decide filter sizesand filter types, while retaining the capability of using block-maps ifdesired. At the same time, the techniques described below mayefficiently search a codebook to determine the best candidate.

Further, the techniques described below may offer flexibility, allowingthe use of a codebook as is, while offering the ability to correct thebest filter available from codebook with a spectral update in relativelyfew bits (which is still more efficient than sending coefficientsthemselves). The accuracy of the spectral update can be controlled.Additionally, the techniques described below allow portions of thecodebook to be replaced or the codebook to be extended by addingcorrected filters that may be better suited to the video sequence to becoded, thus increasing the overall efficiency of the codebook design.

The techniques described below also can work on pictures, slice groups,block maps, merged block maps, or adaptive partitions such as bi-tree,quad-tree, or content dependent regions. The ability of the techniquesdescribed below to work with content dependent partitions also reducescomplexity and improves accuracy as compared to other techniques thatare driven solely by rate distortion optimization.

Details of filter codebook design and efficient search of codebook aredescribed below. With the described method of codebook design and forsuggested codebook size, the techniques described below may result ingood impairments compensation filtering, increasing predictionefficiency for a broad spectrum of video content.

In various embodiments, the techniques described below can be integratedin typical video coding that use traditional picture structures composedof I-, P-, B-picture coding. In other embodiments, the techniquesdescribed below can be integrated in video coding that uses otherstructures in addition to I-, and P-pictures, such as hierarchicalB-pictures, unidirectional B-pictures, and/or B-picture alternatives.

In various embodiments, the codebook based Impairments-Compensation(“IC”) filtering described below can be used as in-loop without displayof the filtered picture, in-loop with display of the filtered picture,and/or as post-processing-only with display of filtered picture. Its usein-loop may allow for compression efficiency gains in addition to visualquality improvement.

Reference is now made in detail to the description of the embodiments asillustrated in the drawings. While embodiments are described inconnection with the drawings and related descriptions, there is nointent to limit the scope to the embodiments disclosed herein. On thecontrary, the intent is to cover all alternatives, modifications andequivalents. In alternate embodiments, additional devices, orcombinations of illustrated devices, may be added to, or combined,without limiting the scope to the embodiments disclosed herein.

FIG. 1 illustrates an exemplary video encoding/decoding system 100according to one embodiment including an unencoded-video source 115, anencoding device 200 (see FIG. 2, discussed below), decoding device 300(see FIG. 3, discussed below) with an optional external display 125, andan optional encoded-video source 120. In some embodiments, one or bothof encoding device 200 and/or decoding device 300 may be connected to anetwork 150. In some embodiments, decoding device 300 and encodingdevice 200 may comprise a single device.

In some embodiments, other servers and/or devices (not shown) may alsobe present. For example, in some embodiments, a distribution server (notshown) may distribute encoded video to decoding device 300 via network150.

In some embodiments, encoding device 200 may communicate withunencoded-video source 115 via network 150, a storage area network(“SAN”), a high speed serial bus, and/or via other suitablecommunication technology. Similarly, in some embodiments, decodingdevice 300 may communicate with encoded-video source 120 via network150, a storage area network (“SAN”), a high speed serial bus, and/or viaother suitable communication technology. In some embodiments, encodingdevice 200, decoding device 300, encoded-video source 120, and/orunencoded-video source 115 may comprise one or more replicated and/ordistributed physical or logical devices.

In various embodiments, network 150 may include the Internet, a localarea network (“LAN”), a wide area network (“WAN”), a cellular datanetwork, and/or other data network. In many embodiments, there may bemore encoding devices 200, decoding devices 300, encoded-video sources120, and/or unencoded-video sources 115 than are illustrated.

FIG. 2 illustrates several components of an exemplary encoding device200, in accordance with one embodiment. In some embodiments, encodingdevice 200 may include many more components than those shown in FIG. 2.However, it is not necessary that all of these generally conventionalcomponents be shown in order to disclose an illustrative embodiment. Asshown in FIG. 2, encoding device 200 includes an optional networkinterface 230 for optionally connecting to the network 150.

The Encoding device 200 also includes a processing unit 210, a memory250, an optional output device and/or display 240, and an optional inputdevice 270 (e.g., a keyboard, mouse, remote, joy stick, and the like),all interconnected along with the optional network interface 230 via abus 220. The memory 250 generally comprises a random access memory(“RAM”), a read only memory (“ROM”), and a permanent mass storagedevice, such as a disk drive. The memory 250 stores a IC filter Codebook265, program code for a Video Encoder with IC Filtering 260, as well asa IC filter codebook generating routine 400 (see FIG. 4, discussedbelow), IC Filter Codebook Search routine 1300 (see FIG. 13, discussedbelow), IC Filter Codebook encoding routine (see FIG. 21, discussedbelow), and Multi-Codebook IC Filter Codebook encoding routine (see FIG.23, discussed below). In addition, the memory 250 also stores anoperating system 255. These software components may be loaded from acomputer readable storage medium 295 into memory 250 of the Encodingdevice 200 using a drive mechanism (not shown) associated with anon-transient computer readable storage medium 295, such as a floppydisc, tape, DVD/CD-ROM drive, memory card, or the like. In someembodiments, software components may also be loaded via the optionalnetwork interface 230, rather than via a computer readable storagemedium 295.

In some embodiments, encoding device 200 may further comprise aspecialized interface 235 for communicating with unencoded-video source115, such as a high speed serial bus, or the like. In some embodiments,encoding device 200 may communicate with unencoded-video source 115 vianetwork interface 230. In other embodiments, unencoded-video source 115may reside in memory 250.

Although an exemplary Encoding device 200 has been described thatgenerally conforms to conventional general purpose computing devices, anencoding device 200 may be any of a great number of devices capable ofencoding video, for example, a video recording device, a videoco-processor and/or accelerator, a personal computer, a game console, aset-top box, a handheld computer, a cell phone, or any other suitabledevice.

FIG. 3 illustrates several components of an exemplary decoding device300), in accordance with one embodiment. In some embodiments, decodingdevice 300 may include many more components than those shown in FIG. 3.However, it is not necessary that all of these generally conventionalcomponents be shown in order to disclose an illustrative embodiment. Asshown in FIG. 3, decoding device 300 includes an optional networkinterface 330 for optionally connecting to the network 150.

The Decoding device 300 also includes a processing unit 310, a memory350, an optional output device and/or display 340, and an optional inputdevice 370 (e.g., a keyboard, mouse, remote, joy stick, and the like),all interconnected along with the optional network interface 330 via abus 320. The memory 350 generally comprises a random access memory(“RAM”), a read only memory (“ROM”), and a permanent mass storagedevice, such as a disk drive. The memory 350 stores program code for aVideo decoder with IC Filtering 360, a IC Filter Codebook 365 (aduplicate copy of IC Filter Codebook 265), program code for a ICFiltering Codebook decoder 360, and IC Filter Codebook decoding routine(see FIG. 24, discussed below). In addition, the memory 350 also storesan operating system 355. These software components may be loaded from acomputer readable storage medium 395 into memory 350 of the Decodingdevice 300 using a drive mechanism (not shown) associated with anon-transient computer readable storage medium 395, such as a floppydisc, tape, DVD/CD-ROM drive, memory card, or the like. In someembodiments, software components may also be loaded via the optionalnetwork interface 330, rather than via a computer readable storagemedium 395.

In some embodiments, decoding device 300 may further comprise aspecialized interface 335 for communicating with encoded-video source120, such as a high speed serial bus, or the like. In some embodiments,decoding device 300 may communicate with encoded-video source 120 vianetwork interface 330. In other embodiments, encoded-video source 115may reside in memory 350.

Although an exemplary Decoding device 300 has been described thatgenerally conforms to conventional general purpose computing devices, andecoding device 300 may be any of a great number of devices capable ofdecoding video, for example, a video-play device, a personal computer, agame console, a set-top box, a handheld computer, a cell phone, or anyother suitable device.

FIG. 4 illustrates an “offline” routine 400 for generating a codebookrepresenting a plurality of sets of IC filter coefficients, inaccordance with one embodiment. In some embodiments, routine 400 maytake hours or even days to perform.

In block 405, a test set including a number of video sequences (e.g. 25to 50), each with a number (e.g. 20-100) of frames, is obtained. In someembodiments, some or all of the video sequences may be selected from oneor more pre-existing video sequences. In other embodiments, some or allof the video sequences may be developed for use with routine 400. Insome embodiments, some or all of the video sequences may have a varietyof characteristics, such as a high contrast, low contrast, high motion,low motion, bright, dark, and the like. In block 410, one or more filtersizes are selected. For example, in one embodiment, one or more of 5×5,7×7, and 9×9 filter sizes may be selected. In block 415, one or moretarget bitrates are selected. For example, in one embodiment, one ormore of low, medium, and high bitrates may be selected.

Beginning in starting loop block 420, each of the filter sizes isaddressed in turn. Beginning in starting loop block 425, each of thevideo sequences is processed in turn. Beginning in starting loop block430, each of the selected bitrates is addressed in turn. Beginning instarting loop block 435, each picture or frame within the current videosequence is processed in turn.

In block 440, the current picture is encoded by a video encoder. Inblock 445, the Wiener filter is computed for the current picture, filtersize, and bitrate by comparing the encoded picture with the originalun-encoded video. In block 450, the computed Wiener filter is stored atleast temporarily as a candidate Wiener filter.

In ending loop block 455, routine 400 loops back to block 435 to processthe next picture in the current video sequence (if any). In ending loopblock 460, routine 400 loops back to block 430 to process the nextbitrate (if any). In ending loop block 465, routine 400 loops back toblock 425 to process the next video sequence (if any).

Once all pictures in all video sequences have been processed for eachbitrate, in block 470, a subset (e.g. 256) of distinct Wiener filtersfrom among the computed candidate Wiener filters is selected to cover arange of filter characteristics (e.g., from smooth to sharp) from low-to high-contrast.

In block 475, the subset of selected filters are sorted (e.g., inascending order according to the center coefficient (or otherrepresentative parameter), e.g., from smooth to sharp (see FIGS. 6a-d ),and stored in a codebook of filter coefficients for the current filtersize.

In ending loop block 480, routine 400 loops back to block 420 to processthe next filter size (if any). Having generated a codebook for eachfilter size, routine 400 ends in block 499, the generated codebooksbeing made available for use by various encoders and decoders.

FIGS. 5a-d respectively illustrate sets of IC filter coefficients of3×3, 5×5, 7×7, and 9×9 non-separable filters, such as may be used inimpairments compensation filtering in various embodiments. For instance,as illustrated in FIG. 5a , in the case of 3×3 filtering, a filtereddecoded picture is created pixel-by-pixel by applying 3×3 filtercoefficients 505 with center coefficient c₁₁ aligned with the pixelbeing filtered using the weighted value of that pixel and thesurrounding 5 pixels with weighting values given by the filtercoefficients. Since the filter is non-separable, all 9 coefficients canhave unique values. Similarly, as illustrated in FIG. 5d , for the caseof 9×9 non-symmetric filtering, the pixel to be filtered is aligned withcenter coefficient c₄₄ and uses, in addition to that pixel, thesurrounding 50 pixels, with each filtered pixel being a weightedcombination of 51 pixels; the filtered pixels are written out as aseparate filtered decoded picture that can be used as reference forprediction and perhaps even for display. In various embodiments, thecoefficients 510, 515 illustrated in FIGS. 5b and 5c may be applied in asimilar manner.

Likewise, FIGS. 5e-h respectively illustrate the coefficients of 3×3,5×5, 7×7, and 9×9 point symmetric filters such as may be used inimpairments compensation filtering in some embodiments. For instance, asillustrated in FIG. 5e , in case of 3×3 filtering, a filtered decodedpicture is created pixel-by-pixel by applying 3×3 filter coefficients525 with center coefficient c₁₁ aligned with pixel being filtered usingthe weighted value of that pixel and surrounding 5 pixels with weightingvalues given by the filter coefficients. Since the filter is pointsymmetric, only 5 coefficients c₀₀, c₀₁, c₀₂, c₁₀, c₁₁ can have uniquevalues with other coefficients simply being diagonally symmetric.Similarly, as illustrated in FIG. 5h , for the case of 9×9 pointsymmetric filtering, only 41 coefficients are unique, the others beingdiagonally symmetric. The pixel to be filtered is aligned with centercoefficient c₄₄ and uses, in addition to that pixel, the surrounding 50pixels, with each filtered pixel being a weighted combination of 51pixels; the filtered pixels are written out as a separate filtereddecoded picture that can be used as reference for prediction and perhapseven for display. In various embodiments, the coefficients 530, 535illustrated in FIGS. 5f and 5g may be applied in a similar manner.

FIG. 6a shows exemplary coefficients of a 9×9 non-separable ‘sharp’filler used in impairments compensation filtering. FIG. 6b showsexemplary coefficients of a 9×9 point symmetric ‘sharp’ filter used inimpairments compensation filtering. FIG. 6c shows exemplary coefficientsof a 9×9 non-separable ‘smooth’ filter used in impairments compensationfiltering. FIG. 6d shows exemplary coefficients of a 9×9 point symmetric‘smooth’ filter used in impairments compensation filtering.

FIG. 7 shows a general block diagram of interframe encoder 700 employingmotion compensated prediction and codebook-based in-loop impairmentscompensation filtering in accordance with one embodiment. One or morevideo frames (vidfrms) are provided to blocks indexer 701 and scenecontent analyzer 703. Scene content analyzer 703 analyzes the one ormore video frames (vidfrms) and outputs a flag indicating scene changes(scnchg), as well as signals indicating image characteristics, such asscene contrast (contr), and region boundaries (regbnd) within the frame.Blocks indexer 701 divides the one or more video frames (vidfrms) intoblocks (blks), which are input one a time to differencer 733 anddifferenced with corresponding prediction signal blocks (pred). Blocks(blks) are also provided to motion estimator 728 (discussed below).After differencing at differencer 733, the resulting residual (res) isforward transformed to a frequency-domain representation by transformer735, resulting in a block of coefficients (tcof) that is then sent tothe quantizer 738 resulting in a block of quantized coefficients (qcf)that are sent both to the entropy coder 718 and to the inverse quantizer740. Inverse quantizer 740 sends de-quantized block of coefficients(tcof′) to the inverse transformer 743. At adder 745, the predictionblock (pred) from the motion compensation loop is added to thede-quantized residual block (res′) at the output of inverse transformer743. Adder 745 outputs the locally decoded block (rec), which is thensent to the frame assembler and deblock filter processor 748, whichreduces the blockiness. The blocks (recd) at the output of frameassembler and deblock filtering processor 748 form a frame that isprocessed by IC Codebook Filter Encoder 750 to impairments-compensatedreconstructed frame (recf), which is used as the reference frame formotion estimator 728 and motion compensated predictor 730. The motionestimator 728 computes motion vectors (mv) between blocks (blks) oforiginal video frame with respect to impairments-compensatedreconstructed frame (recf). In some embodiments, the process of motionvector computation comprises computing an integer pel vector per block,followed by a subpel vector (e.g., to ¼ pel resolution). The entropycoder 718 encodes the quantized transform coefficients (qcf),differential motion vectors (dmv), and other data (including one or moresignals 753 from IC Codebook Filter Encoder 750, generating a compressedbitstream 728. In some embodiments, entropy coder 718 may also provide abit-count (btcnt) to IC Codebook Filter Encoder 750.

FIG. 8 shows a corresponding decoder, and works similarly to the localdecoding loop 755 at the encoder 700. Specifically, the compressedbitstream 801 to be decoded is input to the entropy decoder 803, whichdecodes blocks of quantized coefficients (qcf), differential motionvectors (dmv), and other data, including control signals 818, which maybe provided to IC Codebook Filter Decoder 820 (see, e.g., FIGS. 11, 13,15, and 18, discussed below). The quantized coefficient blocks (qcf) arethen inverse quantized by inverse quantizer 813, resulting inde-quantized coefficients (tcof′). De-quantized coefficients (tcof′) arethen inverse transformed out of the frequency-domain by inversetransformer 815, resulting in decoded residual blocks (res′). Adder 823adds motion compensated prediction blocks (pred) obtained by usingcorresponding motion vectors (mv). The resulting decoded video (rec) isdeblock-filtered in frame assembler and deblock filtering processor 825.Just as at the encoder 800, blocks (recd) at the output of frameassembler and deblock filtering processor 825 form a frame that isprocessed by IC Codebook Filter Decoder 820 to impairments-compensatedreconstructed frame (recf), which is used as the reference frame formotion-compensated predictor 830. The motion compensated predictor 830works in a similar manner as the motion compensated predictor 730 at theencoder 700, such as it uses a similar subpel interpolator.

FIG. 9 illustrates a IC Codebook Filter Encoder 900 in accordance withone embodiment. A video frame (not shown) is divided into blocks (blks),which are input one a time to Encoder 900. Also provided to Encoder 900is reconstructed signal (recd).

Spatial Partitioner and Partitions Encoder 905 determines candidatepartition map (cand. ptmap) and type (cand. pttyp), which are providedto Bitrate/Distortion Tradeoff Analyzer 908. For example, in oneembodiment, candidate partition map (cand. ptmap) may comprise a binarymap (if only two types of regions or blocks types exist), a trinary map(in case there are three types of regions or blocks), two binary maps,or the like.

Bitrate/Distortion Tradeoff Analyzer 908 selects a partition map(selected ptmap or simply ptmap) and partition type (selected pttyp orsimply pttyp), which are returned to Spatial Partitioner and PartitionsEncoder 905 and passed on to IC Filtering Processor 915. In addition, insome embodiments, partition map (ptmap) can be encoded into bitstream928 by entropy coder 918 for transmission to a decoder. However, in itsraw form (e.g., a 0/1 mask, or even multiple 0/1 masks) partition map(ptmap) may have a relatively high bit cost to transmit in raw form.Thus, in many embodiments, a compressed version of partition map(ptmap), referred to as coded partition map (ptmapc), is generated andencoded into bitstream 928 by entropy coder 918. If lossless compressionis used, the decoder can decode coded partition map (ptmapc) and derivethe exact partition map (ptmap) for use at the decoder. In variousembodiments, the compression method used for encoding partition map(ptmap) to generate coded partition map (ptmapc) may include Huffmancoding, run/length coding, arithmetic coding, or other like losslesscoding technique. Furthermore, in some cases lossless compression maynot sufficiently reduce the bit cost to transmit partition map (ptmap).In such cases, coded partition map (ptmapc) may be generated via a lossycompression technique.

In accordance with various embodiments, various different partitioningmodes may be employed by Spatial Partitioner and Partitions Encoder 905and/or Bitrate/Distortion Tradeoff Analyzer 908. In various embodiments,the methods described herein can be applied per frame, per region orsegment, per group of slices, per single slice, per each quad-tree orbi-tree partitions of a frame, per group of macroblocks or blocks of aframe, per tile, per fragments of a tile, and/or by using tile,fragment, macroblock, or block map that may allow selection from among anumber of available filters.

For example, FIGS. 10a-f illustrate various partitioning modes fordividing a picture in accordance with various embodiments. For instance,FIG. 10a illustrates picture-based partitioning, in which filter codesare only switched on a picture-by-picture basis. FIG. 10b illustratesslice or slice-group based partitioning such that a first filter set isapplied on slice group ‘A’, and a second filter set is applied on slicegroup ‘B’. FIG. 10c illustrates a block map that identifies which filterto use for block type ‘A’ and which filter to use for block type ‘B’.FIG. 10d shows division of a picture into tiles and further division oftiles into bi-tree partitions such that various cuts of bi-tree based onrate-distortion optimization (“RDO”) are labeled as ‘A’ or ‘B’,indicating that they may correspondingly use a first or a second filterset. Likewise, FIG. 10e shows partitioning of a picture into tiles, andfurther partitioning of a tile into two types of quad-tree partitionslabeled as ‘A or ‘B’ such that they may correspondingly use a first or asecond filter set. Finally, FIG. 10f shows regions that result frommerging of slices, or merging of blocks, or merging of bi-tree, ormerging of quad-tree partitions, or purely by spatial segmentation.

Referring again to IC Codebook Filter Encoder 900 and FIG. 9, blocks(blks) are provided to Picture(s) Delay 925 and then to CrossCorrelation Vector Calculator 923, which calculates cross-correlationmatrix/row vector (R_(dx)) between source frame block data (blks) andreconstructed frame block data (recd). Auto Correlation MatrixCalculator 920 calculates autocorrelation matrix (R_(xx)) ofreconstructed frame block data (recd).

IC Filter Codebook Search Processor 910 determines a filter size (fsz)(e.g., (e.g. 5×5, 7×7, 9×9, and the like) and mode (md) (e.g.,non-symmetric or point symmetric) according to image characteristics ofthe input picture, such as scene change (scnchg) and contrast (contr).(See FIGS. 8a-h , discussed below.) For example, when the input pictureis ‘low contrast,’ a large filter size (e.g. 9×9) may be determined. Onthe other hand when the input picture is ‘high contrast’, a small filtersize (e.g. 5×5) may be determined if the coding quality is high, or amedium filter size (e.g., 7×7) if the coding quality is medium to low.For medium contrast scenes a medium filter size (e.g., 7×7) may bedetermined when coding quality is sufficient, or a large filter size(e.g., 9×9) when coding quality is low. In some embodiments, the filtersize information is sent on a frame basis.

Using cross-correlation matrix/row vector (R_(dx)) and autocorrelationmatrix (R_(xx)), IC Filter Codebook Lookup Table (“LUT”) and AddressLogic 913 search within the IC Filter Codebook to locate a set of ICfilter coefficients (icfc) that at least substantially fit with thecomputed target set of filter coefficients.

In some embodiments, the codebook search involves applying eachindividual set of IC filter coefficients to the entire reconstructedframe block data (recd). The winning set of filter coefficients isselected to be the set of filter coefficients that yields the smallestSum of Absolute Differences (“SAD”) in respect to the original sourceframe block data (blks).

In other embodiments, the codebook search involves computing acomparison metric or matching criterion, such as the mean square error(“MSE”) of IC filters in the filter codebook, and selecting a set offilter coefficients that minimizes the comparison metric (e.g., MSE,SAD, and the like). For example, the calculation of MSE between twovideo frames, original frame pixels d(n) and filtered reconstructedframe pixels y(n) (obtained by filtering reconstructed frame pixelsx(n)), involves finding sum of square of pixel by pixel differencebetween the two video frames and dividing by number of pixels in a videoframe as follows.

${MSE} = {{1/\left( {{hsz} \times {vsz}} \right)}{\sum\limits_{n}\left( {{d(n)} - {y(n)}} \right)^{2}}}$${SSE} = {\sum\limits_{n}\left( {{d(n)} - {y(n)}} \right)^{2}}$SSE = ∑(d(n))² + ∑(y(n))² − 2∑d(n)y(n)

The general operation of filtering a signal x( ) using a filer h( )resulting in filtered output y( ) can be written as:

y(n)=Σh(k)x(n−k)

Substituting for y( ) in the sum of squares error (“SSE”) equation,

SSE=Σ(d(n))²+ΣΣ(h(k)x(n−k))²−2Σd(n)(Σh(k)x(n−k))

This SSE equation is in fact same as the equation discussed duringfilter calculation, i.e.,

E[e ²(n))=P _(d) +h ^(T) R _(xx) h−2R _(dx) ^(T) h

To find minimum SSE given a set of filters, a filter is located thatresults in

min(h ^(T) R _(xx) h−2R _(dx) ^(T) h)

Further, the autocorrelation matrix R_(xx) or the cross-correlationvector R_(dx) does not depend on the filter h, and, in fact, both theR_(xx) and the R_(dx) were calculated earlier (during calculation of thebest IC filter) for a given frame and thus can be reused.

Comparing the complexity of a correlation based approach to SSEcalculation versus direct calculation of SSE (in terms of multiplyoperations), the complexity of actual filtering is of the order ofhsz×vsz×taps (e.g., for CIF video and 81 tap filtering,352×288×81=8,211,456), whereas the complexity of correlation approach isof the order of taps×taps+taps (e.g., for CIF video and 81 tapfiltering, 81×81+81=6642, or over 1000) times less than that of actualfiltering).

Referring again to FIG. 9, IC Filter Codebook LUT and Address Logic 913therefore search within the IC Filter Codebook to locate a set of ICfilter coefficients (icfc) that minimize MSE (or other matchingcriterion). The index (icfci) of the located set of IC filtercoefficients (icfc), as well as the determined filter size (fsz) andmode (md), is provided to entropy encoder 918 for inclusion in bitstream928. Using the located set of IC filter coefficients (icfc), ICFiltering Processor 915 filters at least a portion of the reconstructedsignal (recd), as indicated by partition map (ptmap) and partition type(pttyp), to a impairments-compensated reconstructed signal (recf) thatis objectively more faithful to the original source signal (representedby source frame block data (blks)) than the non-impairments-compensatedreconstructed signal (recd).

FIG. 11 illustrates an IC Codebook Filter Decoder 1100 corresponding toEncoder 900, discussed above. Compressed bitstream 1101 to be decoded isinput to the entropy decoder 1103, which decodes coded partition map(ptmapc), partition type (pttyp), a filter size (fsz), and an index(icfci) to a set of IC filter coefficients in a codebook of size fsz.

Coded partition map (ptmapc) and partition type (pttyp) are provided toSpatial Partitions Decoder 1105, which decodes coded partition map(ptmapc) and provides decoded partition map (ptmap) to IC FilteringProcessor 1108.

Filter size (fsz) and index (icfci) are provided to IC Filter CodebookLUT and Address Logic 1113, which obtains IC filter coefficients (icfc)from the codebook and provides IC filter coefficients (icfc) to ICFiltering Processor 1108. IC Filtering Processor 1108 applies IC filtercoefficients (icfc) to reconstructed signal (recd), generating animpairments-compensated reconstructed signal (recf).

FIG. 12 illustrates a fast IC Codebook Filter Encoder 1200 in accordancewith one embodiment. IC Codebook Filter Encoder 1200X) is similar inmany respects to IC Codebook Filter Encoder 900, discussed above.However, unlike IC Codebook Filter Encoder 900, Wiener Filter Calculator1230 uses cross-correlation matrix/row vector (R_(dx)) andautocorrelation matrix (R_(xx)) to compute a target set of filtercoefficients (calc.icfc) for a Wiener filter of the given filter size(fsz) and mode (md). Approximate Match Calculator 1233 uses the targetWiener filter coefficients (calc.icfc) to locate within the IC FilterCodebook a set of IC filter coefficients that approximately match thecomputed target set of filter coefficients (calc.icfc). For example, inone embodiment, the approximately matching set of IC filter coefficientsis determined to be the set of coefficients having the closestrepresentative coefficient, such as a center coefficient, to that of thetarget set of filter coefficients (calc.icfc). In one embodiment, thesearch for the closest center coefficient is performed via a binarysearch algorithm, as sets of coefficients in the IC Filter Codebook aresorted according to center coefficient.

Once Approximate Match Calculator 1233 has located the approximatelymatching set of IC filter coefficients, IC Filter Codebook SearchProcessor 1210 determined a neighborhood radius R (e.g. 8 or 16), whichis used to select a comparison group of 2R+1 sets of filter coefficientsincluding R filters before and R filters after the approximatelymatching set of IC filter coefficients in the IC Filter Codebook.

IC Filter Codebook Search Processor 1210 then searches the neighborhoodcomparison group to determine a set of IC filter coefficients (icfc)that minimize MSE (or SAD, or other matching criterion). In someembodiments, IC Filter Codebook Search Processor 1210 further searchesup to eight possible variations (rotations and flips or mirrorings) ofeach set of filter coefficients in the neighborhood comparison group.

Once a good set of IC filter coefficients (icfc) are located, the index(icfci) (as well as the determined filter size (fsz) and mode (md)) isprovided to entropy encoder 1218 for inclusion in bitstream 1228 (alongwith one or more additional bitstream descriptors illustrated in FIG.19, discussed below).

FIG. 13 illustrates a IC Filter Codebook search routine 1300, such asmay be performed by an encoder in accordance with one embodiment. Inblock 1305, routine 1300 obtains an unencoded picture or frame of video.In block 1310, routine 1300 encodes the picture at a certain bitratewith a video encoder. In some embodiments, the video encoder may be aninterframe encoder. In other embodiments, the video encoder may be anintraframe encoder. In block 1315, routine 1300 locally decodes theencoded picture at the video encoder via an in-loop local decoder.

In block 1320, routine 1300) determines the contrast (e.g., low, medium,or high) of the original, unencoded picture. In block 1325, routine 1300selects a filter size (fsz) according to the determined contrast. Forexample, in one embodiment, routine 1300 may select a small filter size(e.g., 5×5) when the contrast is high, a medium or large filter size(e.g., 7×7 or 9×9) when the contrast is low, and a large filter size(e.g., 9×9) otherwise.

In block 1330, routine 1300 selects a filter type (e.g., non-symmetricor symmetric) according to some or all of the encoding bitrate, thedetermined contrast, or other like factors.

In block 1335, routine 1300 computes coefficients for a target Wienerfilter of the selected size (fsz) of the locally decoded picture withregard to the original picture, using the locally decoded picture as thereference signal and the original unencoded picture as the desiredsignal. In block 1340, routine 1300 selects a comparison group includingone or more candidate IC Filters from a codebook. In some embodiments,the one or more candidate IC Filters may be selected by locating anapproximately-matching filter from the codebook (e.g., the IC Filterhaving a close or the closest center coefficient to that of the targetWiener filter), and then selecting several (e.g., 8 or 16) neighboringfilters on either side of the approximately-matching filter. In someembodiments, the neighborhood comparison group may further include oneor more variations or transformations of each of the candidate ICFilters. For example, non-symmetric filters have four rotationvariations and four mirroring variations, while symmetric filters havefour rotation variations.

Beginning in opening loop block 1345, routine 130M) processes each ofthe one or more candidate IC filters, determining in block 1350 an errorestimate (e.g., SAD, MSE, or the like) for the current candidate ICfilter, and looping back from block 1355 to process the next candidateIC filter (if any). In block 1360, routine 1300 selects the candidate ICfilter having a low determined error estimate. In some embodiments,routine 1300 may select the candidate IC filter having the lowestdetermined error estimate.

In decision block 1365, routine 1300 determines whether the selected ICfilter represents an improvement compared to no IC filter. For example,in one embodiment, routine 1300 determines whether the error estimate(e.g., SAD, MSE, or the like) of the decoded picture after IC filteringwith the selected IC filter (compared to the original unencoded picture)is lower than an error estimate of the decoded picture with no ICfiltering. If the selected IC Filter does not provide an improvement,then in block 1370, a one-bit filter-sent flag (fsnt) in the encodedbitstream is set to 0. On the other hand, if the selected IC Filterprovides an improvement, then in block 1375, the one-bit filter-sentflag (fsnt) in the encoded bitstream is set to 1, and in block 1380, anindex of the selected IC filter from the codebook (icfci) is set in theencoded bitstream. In some embodiments, routine 1300 may further set asignal (flt_ornt) (not shown) indicating a variation or transformationof the selected IC filter (e.g., indicating a rotation or mirroringvariation on the selected IC filter). (See FIG. 19, discussed below, fora more detailed explanation of bitstream syntax.) Routine 1300 ends inblock 1399.

FIG. 14 illustrates a fast IC Codebook Filter Encoder 1400 with aspectral update encoder, in accordance with one embodiment. IC CodebookFilter Encoder 1400 is similar in many respects to fast IC CodebookFilter Encoder 1200, discussed above. However, unlike IC Codebook FilterEncoder 1200, IC Codebook Filter Encoder 1400 is able to spectrallyencode updates to the IC filter coefficients (icfc) selected by ICFilter Codebook LUT and Address Logic 1413, as follows.

Wiener Filter Calculator 1430 uses cross-correlation matrix/row vector(R_(dx)) and autocorrelation matrix (R_(xx)) to compute a target set offilter coefficients (calc.icfc) for a Wiener filter of the given filtersize (fsz) and mode (md). As in IC Codebook Filter Encoder 1200,Approximate Match Calculator 1433 uses the target Wiener filtercoefficients (calc.icfc) to locate within the IC Filter Codebook a setof IC filter coefficients that approximately match the computed targetset of filter coefficients (calc.icfc).

However, unlike IC Codebook Filter Encoder 1200, Wiener FilterCalculator 1430 also provides target Wiener filter coefficients(calc.icfc) to differencer 1435, where they are differenced withcorresponding selected IC filter coefficients (icfc).

After differencing at differencer 1435, the resulting coefficientdifferential (icfcd) adjustment values are forward transformed to afrequency-domain representation by transformer 1438, resulting in ablock of transformed differential coefficients that is then sent to thequantizer 1440. Quantizer 1440 quantizes the block of transformeddifferential coefficients according to a quantization parameter (qp,also sometimes referred to as quantization scale) into a block ofquantized transformed differential coefficients that are sent both toscanner 1443 and to inverse quantizer 1445. Scanner 1443 scans the blockof quantized transformed differential coefficients according to areverse-scanning order (see FIG. 16a , discussed below) and provides thescanned transform-coded differential coefficients (tcod.iccof) toentropy encoder 1418 for encoding into bitstream 1428 if indicated byupdate signal (updt) (discussed below).

Inverse quantizer 1445 de-quantizes the block of quantized transformeddifferential coefficients according to quantization parameter (qp) andsends the de-quantized transformed differential coefficients to theinverse transformer 1448. At adder 1450, the inverse-transformedde-quantized differential coefficients are added to the selected ICfilter coefficients (icfc) from IC Filter Codebook LUT and Address Logic1413 to form updated IC filter coefficients (icfcu).

Controller 1455 sends an update signal (updt) to Switch 1453, indicatingwhether Switch 1453 should send to IC Filtering Processor 1415 eitherthe selected IC filter coefficients (icfc) or updated IC filtercoefficients (icfcu). To determine update signal (updt), Controller 1455uses picture-type signal (pictyp) (e.g., I-, P-, or B-picture types) andsignificance signal (sigf). Significance signal (sigf) is a thresholdingchoice made at IC Codebook Filter Encoder 1400 that indicates whetherthe difference between selected IC filter coefficients (icfc) and thetarget IC filter coefficients (calc.icfc) exceeds a pre-determinedsignificance threshold. If the difference exceeds the threshold, thenupdate signal (updt) indicates to Switch 1453 that updated IC filtercoefficients (icfcu) should be used by IC Filtering Processor 1415. Inaddition, update signal (updt) is also encoded to bitstream 1428 byentropy coder 1418.

FIG. 15 illustrates a IC Codebook Filter Decoder 1500 corresponding toIC Codebook Filter Encoder 1400, discussed above. Compressed bitstream1501 is input to the entropy decoder 1503, which decodes coded partitionmap (ptmapc), partition type (pttyp), a filter size (fsz), an updatesignal (updt), scanned transform-coded differential coefficients(tcod.iccof), and an index (icfci) to a set of IC filter coefficients ina codebook of size fsz.

Coded partition map (ptmapc) and partition type (pttyp) are provided toSpatial Partitions Decoder 1505, which decodes coded partition map(ptmapc) and provides decoded partition map (ptmap) to IC FilteringProcessor 1508.

Filter size (fsz) and index (icfci) are provided to IC Filter CodebookLUT and Address Logic 1510, which obtains IC filter coefficients (icfc)from the codebook.

Inverse Scanner 1513 inverse-scans scanned differential transform-codedcoefficients (tcod.iccof) according to a reverse-scanning order (seeFIG. 16a , discussed below) to obtain a block of quantized transformeddifferential coefficients. Inverse quantizer 1515 de-quantizes the blockof quantized transformed differential coefficients according toquantization parameter (qp) and sends the de-quantized transformeddifferential coefficients to the inverse transformer 1520. At adder1523, the inverse-transformed de-quantized differential coefficientadjustment values are added to the selected IC filter coefficients(icfc) to form updated IC filter coefficients (icfcu).

Switch 1525 determines (according to update signal (updt)) whether toprovide the selected IC filter coefficients (icfc) or updated IC filtercoefficients (icfcu) to IC Filtering Processor 1508. IC FilteringProcessor 1508 applies the provided coefficients to reconstructed signal(recd), generating an impairments-compensated reconstructed signal(recf).

FIG. 16a illustrates an exemplary transform coefficient reverse scanningused by IC Codebook Filter Decoder 1500 and IC Codebook Filter Encoder1400. Generally speaking, transform coefficients are often scanned in azigzag order beginning with a DC coefficient (e.g., 1605). However, inthe illustrated reverse-scanning, transform coefficients may be scannedin a zigzag order ending with DC coefficient 1605.

FIG. 16b illustrates an exemplary transform mask that may be used inconnection with coefficient reverse scanning used by IC Codebook FilterDecoder 1800 and IC Codebook Filter Encoder 1700. As illustrated in FIG.16b , a coefficient mask (depicted in shaded cells 1615A-D and the other20 unlabeled shaded cells) may be employed to indicate AC transformcoefficients to include (or, alternately, to be omitted) when scanningin a zigzag order ending towards DC coefficient 1605.

FIG. 17 illustrates a fast IC Codebook Filter Encoder 1700 with aspectral update encoder and updatable codebook, in accordance with oneembodiment. IC Codebook Filter Encoder 1700 is similar in many respectsto IC Codebook Filter Encoder 1400, discussed above. However, unlike ICCodebook Filter Encoder 1400, IC Codebook Filter Encoder 1700 is able tostore updated IC filter coefficients (icfcu) in the codebook as follows.Controller 1755 indicates that the codebook should be updated to storeupdated IC filter coefficients (icfcu) via store signal (str). Storesignal (str) is used by Switch 1758 to determine whether to storeupdated IC filter coefficients (icfcu) in the codebook. Store signal(str) is also encoded by entropy encoder 1718 to bitstream 1728. In someembodiments, Controller 1755 may also indicate a codebook reset signal(not shown) indicating that stored updates should be discarded, thecodebook reverting to its standard form (e.g., at a scene change).

IC Codebook Filter Encoder 1700 also differs from IC Codebook FilterEncoder 1400 in that transform coefficient mask (see FIG. 16b ,discussed above) is used after transforming operations (mask 1758) andbefore inverse transforming operations (unmask 1760).

FIG. 18 illustrates a IC Codebook Filter Decoder 1800 corresponding toIC Codebook Filter Encoder 1700, discussed above. Filter Decoder 1800 issimilar in many respects to IC Codebook Filter Decoder 1500, discussedabove. However, unlike IC Codebook Filter Decoder 1500, IC CodebookFilter Decoder 1800 is able to store updated IC filter coefficients(icfcu) in the codebook as follows. Store signal (str) is decoded byentropy decoder 1803 from bitstream 1801. Store signal (str) is used bySwitch 1758 to determine whether to store updated IC filter coefficients(icfcu) in the codebook. In some embodiments, entropy decoder 1803 mayalso decode a codebook reset signal (not shown) indicating that storedupdates should be discarded, the codebook reverting to its standardform.

FIG. 19 illustrates an exemplary bitstream syntax 1900 for IC CodebookFilter encoders and decoders and variously described herein. Bitstreamsyntax 1900 begins with 2-bit header cicf_hdr 1901. One-bit pict_onlyflag 1902 indicates whether a single IC Filter is specified for theentire picture. Optional 3-bit numpt field 1903 indicates a number ofpartitions (up to eight). Optional 1-bit map_sent flag 1904 indicateswhether a partition map is sent to indicate where the filter is appliedor not, or alternatively, to switch between multiple filters. Optionaln-bit ptmap field 1905 includes the partition map (if any).

One-bit fsnt flag 1906 indicates whether a IC Filter is included in thebitstream. If flag 1906 is set, then optional 1- or 2-bit field fsz 1907indicates a filter size (e.g., 5×5, 7×7, or 9×9) of the included ICFilter, followed by a codeword for the selected filter. The codewordincludes 8-bit icfci field 1908 (an index into a codebook of IC Filters)and 2-bits (separable filters) or 3-bits (non-separable filters) infit_ornt field 1909 indicating the filter's variation or transformationthat should be applied to the coefficients indicated by index icfci 1908(e.g., one of four rotations for separable filters, or one of fourrotations and four mirrorings for non-separable filters). Optional 1-bitupdt flag 1910 indicates whether the bitstream includes a differentialupdate to the coefficients indicated by index icfci 1908. Optional s-bitupdt_dat field 1911 includes a differential update to be applies to thecoefficients indicated by index icfci 1908. When indicated by pict_onlyflag 1902, fields 1906-1911 repeat numpt 1903 times.

FIG. 20a illustrates a sequence of pictures or frames 2001-2008 within avideo stream, including I-frames 2001, 2008, P-frames 2004, 2006, andB-frames 2002-2003, 2005, 2007. FIG. 20b illustrates a sequence ofpictures or frames 2001-2008 within a video stream, including I-frames2001, 2008, which are partitioned into three exemplary partitions(numpt=3); P-frames 2004, 2006, which are partitioned into threeexemplary partitions (numpt=3); and B-frames 2002-2003, 2005, 2007,which are partitioned into two exemplary partitions (numpt=2). Table Iindicates an exemplary coding bit cost for encoding IC Codebook Filtersaccording to various combinations of picture type and number ofpartitions (numpt). (The exemplary coding bit costs shown in Table Iexclude bit costs for spatial partition maps such as regions, slices,tiles or tile fragments, picture bi-tree or quad-tree, tile bi-tree orquad-tree, and/or merged blocks.)

TABLE 1 Picture Number of Filter Sets and Approx. Coding bits cost typenumpt = 1 numpt = 2 numpt = 3 numpt = 4 (and IC Approx. Approx. Approx.Approx. filtering Num Bits Num Bits Num Bits Num Bits mode) Filt. costFilt. cost Filt. cost Filt. cost I (no 1 16 2 33 3 46 4 59 update) P (no1 16 2 33 3 46 4 59 update) B (no 1 16 1 16 2 33 2 33 update)

FIG. 21 illustrates a routine 2100 for encoding a IC filter for apicture of a video into a bitstream using a codebook, in accordance withone embodiment. In block 2105, routine 2100 obtains a codebook includinga plurality of sets of IC filter coefficients suitable for configuringan impairments compensation filter of a video decoder to process framesof encoded videos having a variety of characteristics (e.g., highcontrast, low contrast, and the like). In one embodiment, the codebookmay include 256 sets of filter coefficients, sorted according to arepresentative coefficient (e.g., sorted according to centercoefficient). Other embodiments may include smaller or larger codebooks,sorted according to different criteria.

Beginning in starting loop block 2110, routine 2100 processes eachpicture or frame of a video. In block 2115, routine 2100 analyzes thecurrent picture. For example, in one embodiment, routine 2100 maydetermine one or more image characteristics, such as a contrast leveland/or whether the current picture represents a scene change compared toa previous picture.

In block 2120, routine 2100 determines one or more portions of thecurrent picture. For example, FIGS. 10a-f , discussed above, illustratevarious exemplary portions into which a picture may be divided,according to various embodiments. In some embodiments, the number ofportions that routine 2100 determines may be determined, at least inpart, according to a picture type of the current picture. (See. e.g.,FIG. 20b , discussed above.)

In block 2125, routine 2100 encodes one or more picture-portionindicators to a bitstream. For example, in one embodiment, routine 2100may encode one or more of fields 1902-1905, as illustrated in FIG. 19and discussed above.

Beginning in starting loop block 2130, routine 2100 processes each ofthe one or more determined picture portions. In block 2150, routine2100) adaptively selects a set of IC coefficients from the codebook toimprove how faithfully the video decoder reproduces the currentpicture-portion when the set of IC coefficients is used to configure thedecoder's impairments compensation filter to process the currentpicture-portion. FIGS. 12, 14, and 17, discussed above, illustratevarious methods of adaptively selecting a set of IC coefficients fromthe codebook. For example, in one embodiment, adaptively selecting theset of IC coefficients may include some or all of encoding the unencodedpicture, decoding the encoded picture in a local decoder loop; computinga target set of IC filter coefficients according to the decoded pictureand the unencoded picture, and selecting from the codebook a set of ICfilter coefficients that substantially fits with the target set of ICfilter coefficients. In some embodiments, selecting IC filtercoefficients that substantially fit with the target set may includeselecting an approximately-matching set of coefficients according to arepresentative coefficient (e.g., the center coefficient) andidentifying a comparison group of IC filters neighboring theapproximately-matching set of coefficients. IC filters in the comparisongroup (including zero or more variations of each) may then be scored bydetermining error estimates (e.g., MSE), with the lowest-scoring set ofIC filter coefficients being selected.

In block 2155, routine 2100 determines a filter indicator, such as anindex into the codebook, for the selected set of IC coefficients. Inblock 2160, routine 2100 encodes the filter indicator into the bitstreamto enable a decoder to locate the selected set of IC coefficients fromthe decoder's copy of the codebook.

In decision block 2165, routine 2100 determines whether to send anupdate to the selected set of IC coefficients to further improve howfaithfully the video decoder reproduces the current picture-portioncompared to the selected set of IC coefficients as stored in thecodebook. In some embodiments, the update mechanism may not be used, inwhich case, the determination in block 2165 may always be negative. Inembodiments that use an update mechanism, routine 2100 may determinewhether the updated IC coefficients would improve the reproductionfidelity to a sufficient degree to justify the bit cost of sending theupdate. If an update is determined, then in subroutine block 2200 (seeFIG. 22, discussed below) adjustment values are determined and encodedto update the selected set of IC coefficients at the decoder. In someembodiments, the adjustment values may include quantized transformcoefficients representing differentials between calculated filtercoefficients and the approximate match found from the codebook.

In ending loop block 2190, routine 2100 loops back to block 2130 toprocess the next picture-portion (if any). In ending loop block 2195,routine 2100 loops back to block 2110 to process the next picture (ifany). Once all pictures have been processed, routine 2100 ends in block2199.

FIG. 22 illustrates a IC filter coefficient-set update subroutine 2200,in accordance with one embodiment. In block 2205, subroutine 2200determines a set of adjustment values for adjusting a codebook-storedset of IC filter coefficients. For example, in one embodiment, theadjustment values may include differential coefficient values betweenthe codebook-stored set and a target set of IC filter coefficients.

In block 2210, subroutine 2200 encodes the adjustment values to abitstream to enable a decoder to obtain the adjustment values. In someembodiments, encoding the adjustment values may include computing afrequency-domain representation of the adjustment values and entropycoding the frequency-domain representation according to a reverse zigzagscan order, possibly including only a masked subset of AC coefficients(see, e.g., FIG. 16b , discussed above).

In block 2215, subroutine 2200 encodes into the bitstream an adjustmentindicator directing the video decoder to adjust the codebook-stored setof IC filter coefficients according to the encoded adjustment valuesbefore configuring the decoder's impairments compensation filter toprocess the current portion of the current picture. (See, e.g., bitfields 1910-1911, as illustrated in FIG. 19 and discussed above.)

In decision block 2220, subroutine 2200 determines whether to store theadjusted set of IC filler coefficients in the codebook so that theupdated IC filter coefficients can be re-used without sending theadjustment values again. If so, then in block 2225, subroutine 2200)stores the adjusted set of IC filter coefficients in the encoder's localcopy of the codebook, and in block 2230, subroutine 2200 encoder a storeindicator to the bitstream adjustment indicator directing the videodecoder to store the adjusted coefficient values in the decoder's copyof the codebook. In some embodiments, the store mechanism may not beused, in which case, the determination in block 2220 may always benegative. In embodiments that use the store mechanism, routine 2100 maydetermine whether the adjusted IC coefficients are likely to besubsequently re-used. Subroutine 2200 ends in block 2299.

FIG. 23 illustrates a routine 2300 for encoding a IC filter for apicture of a video into a bitstream using one or more codebooks, inaccordance with one embodiment. In block 2305, routine 2300 obtains oneor more codebooks, each including a plurality of sets of coefficientsfor a IC filter of a given size. In one embodiment, each codebook mayinclude 256 sets of filter coefficients, sorted according to arepresentative coefficient (e.g., sorted according to centercoefficient). Other embodiments may include smaller or larger codebooks,sorted according to different criteria. In one embodiment, one or moreof the codebooks may include coefficients for IC filters of size 3×3,5×5, 7×7, 9×9, 11×11, and the like.

Beginning in starting loop block 2310, routine 2300 processes eachpicture or frame of a video. In block 2315, routine 2300 analyzes thecurrent picture. For example, in one embodiment, routine 2300 maydetermine one or more image characteristics, such as a contrast leveland/or whether the current picture represents a scene change compared toa previous picture.

In block 2320, routine 2300 determines one or more portions of thecurrent picture. For example, FIGS. 10a-f , discussed above, illustratevarious exemplary portions into which a picture may be divided,according to various embodiments. In some embodiments, the number ofportions that routine 2300 determines may be determined, at least inpart, according to a picture type of the current picture. (See, e.g.,FIG. 20b , discussed above.)

In block 2325, routine 2300 encodes one or more picture-portionindicators to a bitstream. For example, in one embodiment, routine 2300may encode one or more of fields 902-1905, as illustrated in FIG. 19 anddiscussed above.

In block 2326, routine 2300 determines a filter size for the currentpicture. In block 2327, routine 2300 encodes the determined filter sizeto the bitstream (see, e.g, field 1907 in FIG. 19, discussed above.) Forexample, when the current picture is ‘low contrast,’ a larger filtersize (e.g. 9×9) may be determined. On the other hand when the inputpicture is ‘high contrast’, a smaller filter size (e.g. 5×5) may bedetermined if the coding quality is high, or a medium filter size (e.g.,7×7) if the coding quality is medium to low. For medium-contrast scenes,a medium filter size (e.g., 7×7) may be determined when coding qualityis sufficient, or a large filter size (e.g., 9×9) when coding quality islow. In some embodiments, the filter size information is sent on apicture or frame basis. In other embodiments, filter size informationmay be determined and sent for each portion of a picture (not shown).

In block 2328, routine 2300 selects a codebook having sets ofcoefficients for IC filters of the selected size. Beginning in startingloop block 2330, routine 2300 processes each of the one or moredetermined picture portions.

In block 2350, routine 2300 adaptively selects a set of IC coefficientsfrom the codebook to improve how faithfully the video decoder reproducesthe current picture-portion when the set of IC coefficients is used toconfigure the decoder's impairments compensation filter to process thecurrent picture-portion.

In block 2355, routine 2300 determines a filter indicator, such as anindex into the codebook, for the selected set of IC coefficients. Inblock 2360, routine 2300 encodes the filter indicator into the bitstreamto enable a decoder to locate the selected set of IC coefficients fromthe decoder's copy of the codebook.

In decision block 2365, routine 2300 determines whether to send anupdate to the selected set of IC coefficients to further improve howfaithfully the video decoder reproduces the current picture-portioncompared to the selected set of IC coefficients as stored in thecodebook. In some embodiments, the update mechanism may not be used, inwhich case, the determination in block 2365 may always be negative. Inembodiments that use an update mechanism, routine 2300 may determinewhether the updated IC coefficients would improve the reproductionfidelity to a sufficient degree to justify the bit cost of sending theupdate. If an update is determined, then in subroutine block 2200 (seeFIG. 22, discussed above) adjustment values are determined and encodedto update the selected set of IC coefficients at the decoder.

In ending loop block 2390, routine 2300 loops back to block 2330 toprocess the next picture-portion (if any). In ending loop block 2395,routine 2300 loops back to block 2310 to process the next picture (ifany). Once all pictures have been processed, routine 2300 ends in block2399.

FIG. 24 illustrates a routine 2400 for decoding a IC filter for apicture of a video from a bitstream using one or more codebooks, inaccordance with one embodiment. In block 2403, routine 2400 obtains oneor more codebooks, each including a plurality of sets of coefficientsfor a IC filter of a given size. These codebooks are copies of thecodebooks available to encoding routines 2200 and/or 2400, discussedabove.

In block 2405, routine 2400 obtains an encoded bitstream includingencoded data corresponding to a plurality of pictures or frames of avideo. Beginning in starting loop block 2408, routine 2400 processeseach picture encoded in the bitstream.

In decision block 2410, routine 2400 determines whether to reset one ormore of the codebooks according to one or more reset signals encodedinto the bitstream. For example, in one embodiment, the encoder maydirect routine 2400 to reset codebooks at scene changes or at othertimes. If a reset signal in the bitstream indicates that one or more ofthe codebooks should be reset (i.e., any previous updates discarded),then in block 2413 the indicated codebook(s) are reverted to theiroriginal state.

In block 2415, routine 2400 decodes the current encoded picture. Inblock 2418, routine 2400 decodes one or more picture-portion indicatorsfrom the bitstream. For example, in one embodiment, routine 2400 maydecode one or more of fields 1902-1905, as illustrated in FIG. 19 anddiscussed above.

Beginning in starting loop block 2420, routine 2400 processes each ofthe one or more indicated picture-portions. In block 2423, routine 2400decodes one or more filter indicators from the bitstream. For example,in one embodiment, routine 2400 may decode one or more of fields1906-1909, as illustrated in FIG. 19 and discussed above.

In block 2425, routine 2400 selects one of the one or more codebooksobtained in block 2403 according to one or more of the decoded filterindicators (e.g., field 1907). In some embodiments, if there was only asingle codebook obtained in block 2403, the one or more of the decodedfilter indicators may be omitted, and routine 2400 may simply select thesingle codebook. In block 2426, routine 2400 selects from the selectedcodebook a set of IC filter coefficients indicated by one or more of thedecoded filter indicators (e.g., field 1908). In some embodiments,selecting the set of IC filter coefficients may further includecomputing a variation or transformation (e.g., a rotation or a mirror)of the set of IC filter coefficients, such as may be indicated by field1909.

In decision block 2428, routine 2400 determines whether the bitstreamhas directed routine 2400 to adjust or update the selected set of ICfilter coefficients. For example, in one embodiment, such a directionmay be transmitted via field 1910. If no update direction has been sent,then in block 2430, routine 2400 configures a IC filter according to theselected set of IC filter coefficients. On the other hand, if an updatedirection has been sent, then in block 2433, routine 2400 decodesadjustment values (e.g., as sent via field 1911) from the bitstream andupdates the selected set of IC filter coefficients according to theadjustment values in block 2435. In block 2430, routine 2400 configuresthe IC filter according to the updated or adjusted set of IC filtercoefficients.

In decision block 2440, routine 2400 determines whether the bitstreamhas directed routine 2400 to store the updated or adjusted set of ICfilter coefficients in the decoder's copy of the codebook so that theupdated IC filter coefficients can be re-used. If such a direction hasbeen received, then in block 2443, routine 2400 stores the updated oradjusted set of IC filter coefficients in the decoder's copy of thecurrent codebook.

In block 2445, routine 2400 processes the current picture-portion usingthe configured IC filter to improve how faithfully the decodedpicture-portion reproduces the corresponding portion of the unencodedoriginal picture.

In ending loop block 2448, routine 2400 loops back to block 2420 toprocess the next picture-portion (if any). In ending loop block 2450,routine 2400 loops back to block 2408 to process the next picture (ifany). Once all pictures have been processed, routine 2400 ends in block2499.

Although specific embodiments have been illustrated and describedherein, it will be appreciated by those of ordinary skill in the artthat alternate and/or equivalent implementations may be substituted forthe specific embodiments shown and described without departing from thescope of the present disclosure. This application is intended to coverany adaptations or variations of the embodiments discussed herein.

1-48. (canceled)
 49. A system comprising: memory to store at least aportion of a codebook corresponding to a plurality of sets of loopfilter coefficients for a loop filter; an interface to receive encodedvideo data including a syntax to enable selection of a set of loopfilter coefficients based on the codebook; and a processor to decode theencoded video data, wherein to decode the encoded video data, theprocessor is to: decode at least a portion of the encoded video datainto at least a block of quantized coefficients, generate a residualblock based on application of an inverse quantization and an inversetransform to the block of quantized coefficients, add, to the residualblock, a loop filtering compensated prediction block from a motioncompensation predictor to form a decoded video block, select, based onthe codebook, the set of loop filter coefficients based on the syntax,process at least a portion of a plurality of decoded blocks includingthe decoded block based on implementation of the selected loop filtercoefficients by the loop filter, and generate decoded video data basedon the plurality of decoded blocks.
 50. The system of claim 49, whereinthe encoded video data further comprises an indicator to indicate thecodebook is to be used for loop filtering at least the portion of thedecoded blocks.
 51. The system of claim 49, wherein the encoded videodata further comprises an indicator to indicate the codebook is not tobe used for loop filtering at least a second portion of the encodedvideo data.
 52. The system of claim 49, wherein the system comprises oneof a computer, a set-top box, a phone, a handheld device, or a gamingconsole.
 53. The system of claim 49, wherein the processor comprises afiltering processor.
 54. The system of claim 49, the processor furtherto select, based on the codebook and the syntax, a second set of loopfilter coefficients and to process at least a second portion of a secondplurality of decoded blocks based on implementation of the secondselected loop filter coefficients by the loop filter.
 55. The system ofclaim 49, wherein the encoded video data further comprises update datato update a second portion of the codebook based on the update data. 56.A method for decoding video comprising: receiving at least a portion ofa codebook corresponding to a plurality of sets of loop filtercoefficients for a loop filter; receiving encoded video data including asyntax to enable selection of a set of loop filter coefficients based onthe codebook; decoding at least a portion of the encoded video data intoat least a block of quantized coefficients; generating a residual blockbased on application of an inverse quantization and an inverse transformto the block of quantized coefficients; adding, to the residual block, aloop filtering compensated prediction block from a motion compensationpredictor to form a decoded video block; selecting, based on thecodebook, the set of loop filter coefficients based on the syntax;processing at least a portion of a plurality of decoded blocks includingthe decoded block based on implementation of the selected loop filtercoefficients by the loop filter; and generating decoded video data basedon the plurality of decoded blocks.
 57. The method of claim 56, whereinthe encoded video data further comprises an indicator to indicate thecodebook is to be used for loop filtering at least the portion of thedecoded blocks.
 58. The method of claim 56, wherein the encoded videodata further comprises an indicator to indicate the codebook is not tobe used for loop filtering at least a second portion of the encodedvideo data.
 59. The method of claim 56, further comprising: selecting,based on the codebook and the syntax, a second set of loop filtercoefficients; and processing at least a second portion of a secondplurality of decoded blocks based on implementation of the secondselected loop filter coefficients by the loop filter.
 60. The method ofclaim 56, wherein the encoded video data further comprises update datato update a second portion of the codebook based on the update data. 61.At least one machine readable medium comprising a plurality ofinstructions that, in response to being executed on a device, cause thedevice to perform video decoding by: receiving at least a portion of acodebook corresponding to a plurality of sets of loop filtercoefficients for a loop filter; receiving encoded video data including asyntax to enable selection of a set of loop filter coefficients based onthe codebook; decoding at least a portion of the encoded video data intoat least a block of quantized coefficients; generating a residual blockbased on application of an inverse quantization and an inverse transformto the block of quantized coefficients; adding, to the residual block, aloop filtering compensated prediction block from a motion compensationpredictor to form a decoded video block; selecting, based on thecodebook, the set of loop filter coefficients based on the syntax,processing at least a portion of a plurality of decoded blocks includingthe decoded block based on implementation of the selected loop filtercoefficients by the loop filter; and generating decoded video data basedon the plurality of decoded blocks.
 62. The machine readable medium ofclaim 61, wherein the encoded video data further comprises an indicatorto indicate the codebook is to be used for loop filtering at least theportion of the decoded blocks.
 63. The machine readable medium of claim61, wherein the encoded video data further comprises an indicator toindicate the codebook is not to be used for loop filtering at least asecond portion of the encoded video data.
 64. The machine readablemedium of claim 61, further comprising instructions that, in response tobeing executed on the device, cause the device to perform video decodingby: selecting, based on the codebook and the syntax, a second set ofloop filter coefficients; and processing at least a second portion of asecond plurality of decoded blocks based on implementation of the secondselected loop filter coefficients by the loop filter.
 65. The machinereadable medium of claim 61, wherein the encoded video data furthercomprises update data to update a second portion of the codebook basedon the update data.
 66. A system comprising: means for receiving atleast a portion of a codebook corresponding to a plurality of sets ofloop filter coefficients for a loop filter; means for receiving encodedvideo data including a syntax to enable selection of a set of loopfilter coefficients based on the codebook; means for decoding at least aportion of the encoded video data into at least a block of quantizedcoefficients; means for generating a residual block based on applicationof an inverse quantization and an inverse transform to the block ofquantized coefficients; means for adding, to the residual block, a loopfiltering compensated prediction block from a motion compensationpredictor to form a decoded video block; means for selecting, based onthe codebook, the set of loop filter coefficients based on the syntax;means for processing at least a portion of a plurality of decoded blocksincluding the decoded block based on implementation of the selected loopfilter coefficients by the loop filter; and means for generating decodedvideo data based on the plurality of decoded blocks.
 67. The system ofclaim 66, wherein the encoded video data further comprises an indicatorto indicate the codebook is to be used for loop filtering at least theportion of the decoded blocks.
 68. The system of claim 66, wherein theencoded video data further comprises an indicator to indicate thecodebook is not to be used for loop filtering at least a second portionof the encoded video data.
 69. The system of claim 66, furthercomprising: means for selecting, based on the codebook and the syntax, asecond set of loop filter coefficients; and means for processing atleast a second portion of a second plurality of decoded blocks based onimplementation of the second selected loop filter coefficients by theloop filter.
 70. The system of claim 66, wherein the encoded video datafurther comprises update data to update a second portion of the codebookbased on the update data.
 71. An apparatus comprising: a processor toreceive at least a portion of a codebook corresponding to a plurality ofsets of loop filter coefficients for a loop filter, to receive encodedvideo data including a syntax to enable selection of a set of loopfilter coefficients based on the codebook, to decode at least a portionof the encoded video data into at least a block of quantizedcoefficients, to generate a residual block based on application of aninverse quantization and an inverse transform to the block of quantizedcoefficients, to add, to the residual block, a loop filteringcompensated prediction block from a motion compensation predictor toform a decoded video block, to select, based on the codebook, the set ofloop filter coefficients based on the syntax, to process at least aportion of a plurality of decoded blocks including the decoded blockbased on implementation of the selected loop filter coefficients by theloop filter, and to generate decoded video data based on the pluralityof decoded blocks.
 72. The apparatus of claim 71, wherein the encodedvideo data further comprises an indicator to indicate the codebook is tobe used for loop filtering at least the portion of the decoded blocks.73. The apparatus of claim 71, wherein the encoded video data furthercomprises an indicator to indicate the codebook is not to be used forloop filtering at least a second portion of the encoded video data. 74.The apparatus of claim 71, wherein the processor comprises a filteringprocessor.
 75. The apparatus of claim 71, the processor further toselect, based on the codebook and the syntax, a second set of loopfilter coefficients and to process at least a second portion of a secondplurality of decoded blocks based on implementation of the secondselected loop filter coefficients by the loop filter.
 76. The apparatusof claim 71, wherein the encoded video data further comprises updatedata to update a second portion of the codebook based on the updatedata.